package com.regexs;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @className: TestWork
 * @description: TODO 类描述
 * @author: YUANG
 * @date: 2022/1/4
 **/
public class TestWork {
    public static void main(String[] args) {
        String orderNo = "R1639833045001_1";
        String orderNo1 = "1639833045078";
        String orderNo2 = "1639833045002";
        String orderNo3 = "1639833045004";
        String orderNo4 = "D1639833045001_1";

        ArrayList<String> list = new ArrayList<>();
        list.add(orderNo);
        list.add(orderNo1);
        list.add(orderNo2);
        list.add(orderNo3);
        list.add(orderNo4);
        List<String> collect = list.stream().filter(i -> i.matches("^\\d*$")).collect(Collectors.toList());
        System.out.println(collect);
    }
}
